package com._21cn.cms.article.service;

import com._21cn.cms.article.entity.ColumnArticle;
import com._21cn.framework.base.db.BaseDao;
import com._21cn.framework.base.service.impl.BaseServiceImpl;

import com._21cn.cms.article.dao.RegionArticleDao;
import com._21cn.cms.article.entity.RegionArticle;

import com._21cn.framework.flip.PageList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.Map;


@Service("regionArticleService")
public class RegionArticleService extends BaseServiceImpl<RegionArticle> {
	
    @Autowired
    private RegionArticleDao regionArticleDao;

    @Override
    protected BaseDao<RegionArticle> getBaseDao() {
        return regionArticleDao;
    }

    //获取栏目文章
    public RegionArticle getRegionArticle(int regionId, int articleId ){
        Map<String,Object> paramMap = new HashMap<String,Object>();
        paramMap.put("eqRegionId", regionId);
        paramMap.put("eqArticleId", articleId);
        PageList<RegionArticle> list = getList(paramMap, 1, 1, false);
        return list.isEmpty() ? null : list.get(0);
    }
}